<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>2-33vue生命周期之数据更新</title>
</head>
<body>
<div id="app">
    <div v-if="isShow" ref="self">test</div>
    <button @click="isShow=!isShow">update</button>
</div>
</body>
<script src="./js/vue.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            isShow:false
        },
        beforeUpdate() {
            console.log("update instance before")
            console.log(this.$refs.self)
        },
        updated() {
            console.log("updated instance after")
            console.log(this.$refs.self)
        }
    })
</script>
</html>